{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import arcpy"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "pnt = arcpy.Point(116.403927,39.915087)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {},
   "outputs": [],
   "source": [
    "sr = arcpy.SpatialReference(4326)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [],
   "source": [
    "pntgeo = arcpy.PointGeometry(inputs=pnt,spatial_reference= sr)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<Point (116.403927, 39.915087, #, #)>"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pnt"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "ename": "AttributeError",
     "evalue": "'Point' object has no attribute 'WKT'",
     "output_type": "error",
     "traceback": [
      "\u001b[1;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m                            Traceback (most recent call last)",
      "\u001b[1;32m<ipython-input-15-df8cdb91b6d9>\u001b[0m in \u001b[0;36m<module>\u001b[1;34m\u001b[0m\n\u001b[1;32m----> 1\u001b[1;33m \u001b[0mpnt\u001b[0m\u001b[1;33m.\u001b[0m\u001b[0mWKT\u001b[0m\u001b[1;33m\u001b[0m\u001b[1;33m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[1;31mAttributeError\u001b[0m: 'Point' object has no attribute 'WKT'"
     ]
    }
   ],
   "source": [
    "pnt.WKT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "'POINT (116.403927 39.915087)'"
      ]
     },
     "execution_count": 12,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pntgeo.WKT"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "WKT:POINT (116.403927 39.915087)\n",
      "WKB:bytearray(b'\\x01\\x01\\x00\\x00\\x00+\\xbe\\xa1\\xf0\\xd9\\x19]@T\\xff \\x92!\\xf5C@')\n",
      "json:{\"x\":116.403927,\"y\":39.915087,\"spatialReference\":{\"wkid\":4326,\"latestWkid\":4326}}\n"
     ]
    }
   ],
   "source": [
    "print(f\"WKT:{pntgeo.WKT}\")\n",
    "print(f\"WKB:{pntgeo.WKB}\")\n",
    "print(f\"JSON:{pntgeo.JSON}\")"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": "<svg xmlns=\"http://www.w3.org/2000/svg\" xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"100.0\" height=\"100.0\" viewBox=\"105.603927 29.115087 21.599999999999994 21.599999999999998\" preserveAspectRatio=\"xMinYMin meet\"><g transform=\"matrix(1,0,0,-1,0,79.830174)\"><path fill-rule=\"evenodd\" fill=\"#66cc99\" stroke=\"#555555\" stroke-width=\"0.43199999999999994\" opacity=\"0.6\" d=\" M 116.403927,49.915087 L 117.39960546595816,49.865394753654016 L 118.38538843199397,49.71681187848544 L 119.35147874410903,49.47081505786141 L 120.28827496274694,49.12984911870407 L 121.18646678621317,48.69730273370229 L 122.03712758063621,48.17747474315995 L 122.83180309686539,47.57553143118978 L 123.56259549259718,46.89745518086073 L 124.2222418246803,46.14998501858734 L 124.80418623150771,45.34054963865759 L 125.30264508811469,44.47719357353163 L 125.71266448644204,43.56849724366395 L 126.03016946950012,42.62349168143005 L 126.25200453012208,41.65156877666931 L 126.3759649718118,40.662387935864245 L 126.40081882000815,39.66578008261927 L 126.32631906600172,38.67164995352515 L 126.15320612181823,37.689877660436856 L 125.88320046167132,36.73022049748316 L 125.51898552311673,35.802215968693886 L 125.06418103784438,34.915087 L 124.52330705715856,34.077650277652104 L 123.90173902967734,33.29822862403141 L 123.2056543777092,32.584568281701735 L 122.44197110325477,31.943761927770773 L 121.61827903379498,31.382178183678445 L 120.74276439117558,30.905398320975806 L 119.82412843325669,30.518160792140918 L 118.87150097690294,30.22431413770922 L 117.89434966176174,30.026778737748714 L 116.90238585660697,29.92751778781078 L 115.90546814339302,29.92751778781078 L 114.91350433823825,30.026778737748714 L 113.93635302309706,30.22431413770922 L 112.9837255667433,30.518160792140918 L 112.06508960882442,30.905398320975806 L 111.18957496620502,31.38217818367844 L 110.36588289674522,31.943761927770773 L 109.6021996222908,32.584568281701735 L 108.90611497032266,33.2982286240314 L 108.28454694284143,34.0776502776521 L 107.74367296215561,34.915087 L 107.28886847688327,35.802215968693886 L 106.92465353832868,36.73022049748315 L 106.65464787818176,37.68987766043685 L 106.48153493399828,38.67164995352514 L 106.40703517999184,39.66578008261927 L 106.4318890281882,40.66238793586424 L 106.55584946987791,41.6515687766693 L 106.77768453049987,42.62349168143005 L 107.09518951355795,43.568497243663955 L 107.5052089118853,44.47719357353163 L 108.00366776849228,45.34054963865759 L 108.5856121753197,46.14998501858733 L 109.24525850740281,46.89745518086073 L 109.97605090313459,47.57553143118977 L 110.77072641936377,48.17747474315995 L 111.62138721378682,48.69730273370229 L 112.51957903725305,49.12984911870407 L 113.45637525589095,49.4708150578614 L 114.422465568006,49.71681187848544 L 115.40824853404182,49.865394753654016 L 116.403927,49.915087 z\" /></g></svg>",
      "text/plain": [
       "<Polygon object at 0x19caaf26188[0x19caaf25030]>"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "pntgeo.buffer(10)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.7.11 ('base')",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.11"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "06b308fdbfd5979111721ebbf4de1ae2cbf405c7740d4ab5c57cb4c3e518bed6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
